@import "../../themes/ionic.globals";

// Item Sliding
// --------------------------------------------------
// The hidden right-side buttons that can be exposed under a list item with dragging.

ion-item-sliding {
  position: relative;
  display: block;
  overflow: hidden;

  width: 100%;
}

ion-item-sliding .item {
  position: static;
}

ion-item-options {
  position: absolute;
  top: 0;
  right: 0;
  z-index: $z-index-item-options;
  display: none;

  justify-content: flex-end;

  height: 100%;

  font-size: 14px;

  visibility: hidden;
}

ion-item-options[side=left] {
  right: auto;
  left: 0;

  justify-content: flex-start;
}

ion-item-options .button {
  margin: 0;
  padding: 0 .7em;

  height: 100%;

  border-radius: 0;
  box-shadow: none;

  box-sizing: content-box;
}

ion-item-options:not([icon-left]) .button:not([icon-only]) {
  .button-inner {
    flex-direction: column;
  }

  ion-icon {
    padding-right: 0;
    padding-bottom: .3em;
    padding-left: 0;
  }
}

ion-item-sliding.active-slide {

  .item,
  .item.activated {
    position: relative;
    z-index: $z-index-item-options + 1;

    opacity: 1;
    transition: transform 500ms cubic-bezier(.36, .66, .04, 1);

    pointer-events: none;

    will-change: transform;
  }

  ion-item-options {
    display: flex;
  }

  &.active-options-left ion-item-options[side=left] {
    width: 100%;

    visibility: visible;
  }

  &.active-options-right ion-item-options:not([side=left]) {
    width: 100%;

    visibility: visible;
  }
}

// Item Expandable Animation
// --------------------------------------------------

button[expandable] {
  flex-shrink: 0;

  transition-duration: 0;
  transition-property: none;
  transition-timing-function: cubic-bezier(.65, .05, .36, 1);
}

ion-item-sliding.active-swipe-right button[expandable] {
  order: 1;

  padding-left: 90%;

  transition-duration: .6s;
  transition-property: padding-left;
}

ion-item-sliding.active-swipe-left button[expandable] {
  order: -1;

  padding-right: 90%;

  transition-duration: .6s;
  transition-property: padding-right;
}
